/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // cookie sign key
  config.keys = appInfo.name + '_ali15298365607_5732';

  // add your middleware config here
  // config.middleware = []

  config.view = {
    defaultViewEngine: 'nunjucks',
    mapping: {
      '.tpl': 'nunjucks',
    },
  };

  config.news = {
    pageSize: 5,
    serverUrl: 'https://hacker-news.firebaseio.com/v0',
  };

  // config.middleware = [ 'robot' ]

  // config.robot = {
  //   ua: [ /Baiduspider/i ],
  // }

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.sequelize = {
    dialect: 'mysql',
    host: '127.0.0.1',
    port: '3306',
    username: 'root',
    password: '1234qwer',
    database: 'egg-mysql',
    // timezone: '+08:00', // 保存为本地时区
  };

  return {
    ...config,
    ...userConfig,
  };
};
